{include file="public/toper"/}
<style>
    .table_td {text-align: center;}
    .table_p {height: 20px;}
    .layui-table {width: 80%;margin: 0 auto;text-align: left;}
    .tis {margin-left:6%;}
    .color {color: #FF0000}
    .a {width: 80%;margin: 5px auto;}
</style>

<div class="x-body">
    <table class="layui-table">
        <p class="tis">结算信息</p>
        <tr>
            <td>结算单号：{$list['settlement_sn']}</td>
            <td>状态：<span class="color">{if condition="$list['pay_state'] eq 0"}未付款{elseif condition="$list['pay_state'] eq 1"/}已付款{/if}</span></td>
        </tr>
        <tr>
            <td>申请人：{$list['name']}</td>
            <td>申请时间：{$list['add_time']|date="Y-m-d H:i:s",###}</td>
        </tr>
        <tr>
            <td>结算订单数：<span class="color">{$list['orderid']}</span></td>
            <td>结算总费用：<span class="color">￥{$list['fees']}</span></td>
        </tr>
    </table>

    <p class="table_p"></p>
    <table class="layui-table">
        <p class="tis">结算明细</p>
        <thead>
        <tr>
            <th>序号</th>
            <th>订单编号</th>
            <th>商品信息</th>
            <th>销售金额</th>
            <th>结算金额</th>
            <th>下单时间/完成时间</th>
        </tr>
        </thead>

        <tbody>
        {volist name="$list['order']" id="vo" key="key"}
        <tr>
            <td>{$key}</td>
            <td>{$vo.order_sn}<br/>{if condition="$vo['type'] eq 1"}共享{elseif condition="$vo['type'] eq 2"/}销售{/if}</td>
            <td>{volist name="$vo['goods']" id="vv"}{$vv['gname']}     * {$vv['goods_number']}<br/>{if condition="$vo['type'] eq 1"}周期：{$vo['lease_end_time']}   日租：{$vv['settlement']}{/if}{/volist}</td>
            <td>{volist name="$vo['goods']" id="vv"}<span class="color">{$vv['goods_price']}</span>{/volist}<br/>{if condition="$vo['type'] eq 1"}逾期：{$vo['overdue_price']} <br/>磨损：{$vo['abrasion_price']}{/if}</td>
            <td>{volist name="$vo['goods']" id="vv"}{if condition="$vo['type'] eq 1"}<span class="color">{$vo['lease_end_time'] * $vo['business_settlement_price'] + $vo['abrasion_price']}</span>{elseif condition="$vo['type'] eq 2"/}<span class="color">{$vo['business_settlement_price']}</span>{/if}{/volist}<br/>{if condition="$vo['type'] eq 1"}{volist name="$vo['goods']" id="vv"}租金：{$vo['lease_end_time'] * $vv['settlement'] * $vv['goods_number']}<br/>{/volist}逾期：{$vo['overdue_price']}<br/>磨损：{$vo['abrasion_price']}{/if}</td>
            <td>{$vo['add_time']|date="Y-m-d H:i:s",###} <br/>{$vo['end_time']|date="Y-m-d H:i:s",###}</td>
        </tr>
        {/volist}
        </tbody>
    </table>

    <p class="table_p"></p>
    <p class="tis">付款信息</p>


    <table class="layui-table">
        <tr>
            <td>商家账号：</td>
            <td>银行：{$list.bank}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;       账户名称：{$list.username}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;       账号：{$list.number}</td>
        </tr>
        <tr>
            <td>付款方式：</td>
            <td>{if condition="$list['pay_way'] eq 0"}支票{elseif condition="$list['pay_way'] eq 1"/}贷记{elseif  condition="$list['pay_way'] eq 2"/}汇票{elseif  condition="$list['pay_way'] eq 3"/}现金{elseif  condition="$list['pay_way'] eq 4"/}银行卡{elseif  condition="$list['pay_way'] eq 5"/}其他{/if}</td>
        </tr>
        <tr>
            <td>付款金额：</td><td><span class="color">{$list['fees']}</span></td>
        </tr>
        <tr>
            <td>付款凭证：</td>
            <td>
                {volist name="$list.pay_img" key="key" id="vo"}
                <img width="100" height="100" src="{$vo}" class="thumbs{$key}" thumb="{$vo}" />
                <script>
                    layui.use(['table'], function(){
                        var layer = layui.layer,$ = layui.jquery;

                        var layertips = null;
                        $(document).on('mouseenter','.thumbs'+{$key},function(){
                            //console.log(event);
                            var im = ('<img class="thumb-show" src="'+$(this).attr('thumb')+'" >');
                            var link = $(this).attr('href');
                            //layertip=layer.tips('<img style="" src='"/ >', this, { tips:[2,'#009688'] ,area: ['宽度', '高度'],time:false});
                            layertips = layer.tips( im, this, {
                                tips: [2,'#009688'],
                                skin: 'demo_class',
                                time: false,
                            });
                        });

                        //隐藏缩略图
                        $(document).on('mouseleave','.thumbs'+{$key}, function() {
                            layer.close(layertips);
                        });
                    });
                </script>
                {/volist}
        </td>
        </tr>
        <tr>
            <td>备注信息：</td><td>{$list['note']}</td>
        </tr>
        <tr>
            <td>付款人：</td><td>{$list['admin_user_id']}</td>
        </tr>
        <tr>
            <td>付款时间：</td><td>{$list['pay_time']|date="Y-m-d H:i:s",###}</td>
        </tr>
    </table>
</div>
{include file="public/footer"/}